Returns the global environment table, which is shared across all potassium-made threads. This table is commonly used to share or store information between different potassium-executed scripts.
local alreadyRan = getgenv().alreadyRanif alreadyRan then print("Already ran!")else print("Hello, world!") getgenv().alreadyRan = trueend
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Potassium","colors":{"primary":"#FFFFFF","light":"#FFFFFF","dark":"#15803D"},"logo":{"light":"https://mintlify.s3.us-west-1.amazonaws.com/potassium/logo/light.svg","dark":"https://mintcdn.com/potassium/SWfW51USBYZ_Au-a/logo.png?fit=max\u0026auto=format\u0026n=SWfW51USBYZ_Au-a\u0026q=85\u0026s=e121ed02da2c83ea39ffb21481e9aaab"},"favicon":{"light":"https://mintcdn.com/potassium/zu-AwEKDF_25h-V7/favicon.ico?fit=max\u0026auto=format\u0026n=zu-AwEKDF_25h-V7\u0026q=85\u0026s=fda5d20362b31744fa06a0f61403622f","dark":"https://mintcdn.com/potassium/zu-AwEKDF_25h-V7/favicon.ico?fit=max\u0026auto=format\u0026n=zu-AwEKDF_25h-V7\u0026q=85\u0026s=fda5d20362b31744fa06a0f61403622f"},"appearance":{"default":"dark","strict":true},"background":{"color":{"light":"#ffffff","dark":"#101010"}},"footer":{"socials":{"discord":"https://discord.gg/potassium"}},"integrations":{"telemetry":{"enabled":true}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"potassium","hasAudioNarration":false,"actualSubdomain":"potassium","customDomains":["docs.potassium.pro"],"gitSource":{"type":"github","owner":"mintlify-community","repo":"docs-potassium-d550ab13","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aa350a7317a355b0ab51ee9","collectionId":"4b51136f-4ca7-4d45-8093-0e3c04984411","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aa350a7317a355b0ab51ee9"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6aa350a7317a355b0ab51ee9","clientVersion":"0.0.3971","searchFilterCounts":[{"language":"default","tag":"API Reference","count":198},{"language":"default","tag":"Debug Library","count":18},{"language":"default","tag":"Drawing Library","count":16},{"language":"default","tag":"Miscellaneous Functions","count":16},{"language":"default","tag":"Closure Functions","count":13},{"language":"default","tag":"Input Functions","count":13},{"language":"default","tag":"Reflection Functions","count":13},{"language":"default","tag":"Script Functions","count":13},{"language":"default","tag":"Crypt Library","count":11},{"language":"default","tag":"FileSystem Functions","count":11}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":".dark div[class*=bg-codeblock]{background-color:#0b0b0b!important}"}],"page":{"pagePath":"api-reference/Environment Library/getgenv","slug":"/api-reference/Environment Library/getgenv","pageMetadata":{"title":"getgenv","description":"Returns the global environment table, which is shared across all potassium-made threads. This table is commonly used to share or store information between different potassium-executed scripts.","href":"/api-reference/Environment Library/getgenv"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Returns the global environment table, which is shared across all potassium-made threads. This table is commonly used to share or store information between different potassium-executed scripts.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);return _jsxs(_Fragment,{children:[_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`lua`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`lua`,children:_jsxs(_components.code,{language:`lua`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` getgenv`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(): { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`any`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`example`,children:`Example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`lua`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`lua`,children:_jsxs(_components.code,{language:`lua`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`local`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` alreadyRan`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` getgenv`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`alreadyRan`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` alreadyRan`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` then`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Already ran!\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello, world!\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` getgenv`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`alreadyRan`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`end`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"getgenv","description":"Returns the global environment table, which is shared across all potassium-made threads. This table is commonly used to share or store information between different potassium-executed scripts.","href":"/api-reference/Environment Library/getgenv"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Example","slug":"example","depth":3,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"potassium","siteName":"Potassium","title":"getgenv - Potassium","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-04-19T17:49:59.117Z","originalFileLocation":"api-reference/Environment Library/getgenv.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Returns the global environment table, which is shared across all potassium-made threads. This table is commonly used to share or store information between different potassium-executed scripts.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Potassium\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/potassium/wYfNeBl8-PtFNBfv/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/potassium/wYfNeBl8-PtFNBfv/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/potassium/wYfNeBl8-PtFNBfv/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/potassium/wYfNeBl8-PtFNBfv/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/potassium/wYfNeBl8-PtFNBfv/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/potassium/wYfNeBl8-PtFNBfv/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/potassium/wYfNeBl8-PtFNBfv/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/potassium/wYfNeBl8-PtFNBfv/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/potassium/wYfNeBl8-PtFNBfv/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"getgenv - Potassium\">\u003cmeta data-mint-head property=\"og:description\" content=\"Returns the global environment table, which is shared across all potassium-made threads. This table is commonly used to share or store information between different potassium-executed scripts.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Potassium\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.potassium.pro/api-reference/Environment Library/getgenv\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://potassium.mintlify.app/_mintlify/api/og/v2?division=Environment+Functions\u0026amp;title=getgenv\u0026amp;description=Returns+the+global+environment+table%2C+which+is+shared+across+all+potassium-made+threads.+This+table+is+commonly+used+to+share+or+store+information+between+diffe\u0026amp;theme=e990a9736829fb48d4291b3a\u0026amp;signature=4567186552ecb213aa15bb7b0f89a581ce39a086feec58d5cc531a5646831fdb\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"getgenv - Potassium\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Returns the global environment table, which is shared across all potassium-made threads. This table is commonly used to share or store information between different potassium-executed scripts.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://potassium.mintlify.app/_mintlify/api/og/v2?division=Environment+Functions\u0026amp;title=getgenv\u0026amp;description=Returns+the+global+environment+table%2C+which+is+shared+across+all+potassium-made+threads.+This+table+is+commonly+used+to+share+or+store+information+between+diffe\u0026amp;theme=e990a9736829fb48d4291b3a\u0026amp;signature=4567186552ecb213aa15bb7b0f89a581ce39a086feec58d5cc531a5646831fdb\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/potassium/wYfNeBl8-PtFNBfv/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Potassium\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FFFFFF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.potassium.pro/api-reference/Environment Library/getgenv\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/Environment%20Library/getgenv.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.potassium.pro/#organization\",\"name\":\"Potassium\",\"url\":\"https://docs.potassium.pro\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintlify.s3.us-west-1.amazonaws.com/potassium/logo/light.svg\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.potassium.pro#website\",\"name\":\"Potassium\",\"url\":\"https://docs.potassium.pro\",\"publisher\":{\"@id\":\"https://docs.potassium.pro/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.potassium.pro/api-reference/Environment%20Library/getgenv#webpage\",\"url\":\"https://docs.potassium.pro/api-reference/Environment%20Library/getgenv\",\"name\":\"getgenv\",\"description\":\"Returns the global environment table, which is shared across all potassium-made threads. This table is commonly used to share or store information between different potassium-executed scripts.\",\"dateModified\":\"2026-04-19T17:49:59.117Z\",\"isPartOf\":{\"@id\":\"https://docs.potassium.pro#website\"},\"breadcrumb\":{\"@id\":\"https://docs.potassium.pro/api-reference/Environment%20Library/getgenv#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.potassium.pro/api-reference/Environment%20Library/getgenv#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.potassium.pro/api-reference/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Environment Functions\",\"item\":\"https://docs.potassium.pro/api-reference/Environment%20Library/filtergc\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"getgenv\",\"item\":\"https://docs.potassium.pro/api-reference/Environment%20Library/getgenv\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.potassium.pro/api-reference/Environment%20Library/getgenv#article\",\"headline\":\"getgenv\",\"name\":\"getgenv\",\"description\":\"Returns the global environment table, which is shared across all potassium-made threads. This table is commonly used to share or store information between different potassium-executed scripts.\",\"url\":\"https://docs.potassium.pro/api-reference/Environment%20Library/getgenv\",\"mainEntityOfPage\":{\"@id\":\"https://docs.potassium.pro/api-reference/Environment%20Library/getgenv#webpage\"},\"dateModified\":\"2026-04-19T17:49:59.117Z\",\"publisher\":{\"@id\":\"https://docs.potassium.pro/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.potassium.pro#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Potassium\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Potassium","nav":{"global":null,"groups":[{"group":"API Reference","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"group":"Actor Functions","pages":[{"title":"create_comm_channel","href":"/api-reference/Actor Library/create_comm_channel"},{"title":"getactors","href":"/api-reference/Actor Library/getactors"},{"title":"getactorthreads","href":"/api-reference/Actor Library/getactorthreads"},{"title":"getdeletedactors","href":"/api-reference/Actor Library/getdeletedactors"},{"title":"get_comm_channel","href":"/api-reference/Actor Library/get_comm_channel"},{"title":"is_parallel","href":"/api-reference/Actor Library/is_parallel"},{"title":"run_on_actor","href":"/api-reference/Actor Library/run_on_actor"},{"title":"run_on_thread","href":"/api-reference/Actor Library/run_on_thread"}]},{"group":"Cache Library","pages":[{"title":"cache.invalidate","href":"/api-reference/Cache Library/cache.invalidate"},{"title":"cache.iscached","href":"/api-reference/Cache Library/cache.iscached"},{"title":"cache.replace","href":"/api-reference/Cache Library/cache.replace"},{"title":"cloneref","href":"/api-reference/Cache Library/cloneref"},{"title":"compareinstances","href":"/api-reference/Cache Library/compareinstances"}]},{"group":"Closure Functions","pages":[{"title":"getfunctionhash","href":"/api-reference/Closure Library/getfunctionhash"},{"title":"iscclosure","href":"/api-reference/Closure Library/iscclosure"},{"title":"isexecutorclosure","href":"/api-reference/Closure Library/isexecutorclosure"},{"title":"islclosure","href":"/api-reference/Closure Library/islclosure"},{"title":"isnewcclosure","href":"/api-reference/Closure Library/isnewcclosure"},{"title":"hookfunction","href":"/api-reference/Closure Library/hookfunction"},{"title":"isfunctionhooked","href":"/api-reference/Closure Library/isfunctionhooked"},{"title":"isourthread","href":"/api-reference/Closure Library/isourthread"},{"title":"loadstring","href":"/api-reference/Closure Library/loadstring"},{"title":"newcclosure","href":"/api-reference/Closure Library/newcclosure"},{"title":"newlclosure","href":"/api-reference/Closure Library/newlclosure"},{"title":"restorefunction","href":"/api-reference/Closure Library/restorefunction"},{"title":"setstackhidden","href":"/api-reference/Closure Library/setstackhidden"}]},{"group":"Console Library","pages":[{"title":"rconsoleclear","href":"/api-reference/Console Library/rconsoleclear"},{"title":"rconsolecreate","href":"/api-reference/Console Library/rconsolecreate"},{"title":"rconsoledestroy","href":"/api-reference/Console Library/rconsoledestroy"},{"title":"rconsoleerror","href":"/api-reference/Console Library/rconsoleerror"},{"title":"rconsoleinfo","href":"/api-reference/Console Library/rconsoleinfo"},{"title":"rconsoleinput","href":"/api-reference/Console Library/rconsoleinput"},{"title":"rconsoleprint","href":"/api-reference/Console Library/rconsoleprint"},{"title":"rconsolesettitle","href":"/api-reference/Console Library/rconsolesettitle"},{"title":"rconsolewarn","href":"/api-reference/Console Library/rconsolewarn"}]},{"group":"Crypt Library","pages":[{"title":"crypt.base64decode","href":"/api-reference/Crypt Library/crypt.base64decode"},{"title":"crypt.base64encode","href":"/api-reference/Crypt Library/crypt.base64encode"},{"title":"crypt.decrypt","href":"/api-reference/Crypt Library/crypt.decrypt"},{"title":"crypt.encrypt","href":"/api-reference/Crypt Library/crypt.encrypt"},{"title":"crypt.generatebytes","href":"/api-reference/Crypt Library/crypt.generatebytes"},{"title":"crypt.generatekey","href":"/api-reference/Crypt Library/crypt.generatekey"},{"title":"crypt.hash","href":"/api-reference/Crypt Library/crypt.hash"},{"title":"crypt.hmac","href":"/api-reference/Crypt Library/crypt.hmac"},{"title":"crypt.lz4compress","href":"/api-reference/Crypt Library/crypt.lz4compress"},{"title":"crypt.lz4decompress","href":"/api-reference/Crypt Library/crypt.lz4decompress"},{"title":"crypt.random","href":"/api-reference/Crypt Library/crypt.random"}]},{"group":"Debug Library","pages":[{"title":"debug.getcallstack","href":"/api-reference/Debug Library/debug.getcallstack"},{"title":"debug.getconstant","href":"/api-reference/Debug Library/debug.getconstant"},{"title":"debug.getconstants","href":"/api-reference/Debug Library/debug.getconstants"},{"title":"debug.getinfo","href":"/api-reference/Debug Library/debug.getinfo"},{"title":"debug.getproto","href":"/api-reference/Debug Library/debug.getproto"},{"title":"debug.getprotos","href":"/api-reference/Debug Library/debug.getprotos"},{"title":"debug.getregistry","href":"/api-reference/Debug Library/debug.getregistry"},{"title":"debug.getsafeenv","href":"/api-reference/Debug Library/debug.getsafeenv"},{"title":"debug.getstack","href":"/api-reference/Debug Library/debug.getstack"},{"title":"debug.getupvalue","href":"/api-reference/Debug Library/debug.getupvalue"},{"title":"debug.getupvalues","href":"/api-reference/Debug Library/debug.getupvalues"},{"title":"debug.isvalidlevel","href":"/api-reference/Debug Library/debug.isvalidlevel"},{"title":"debug.setconstant","href":"/api-reference/Debug Library/debug.setconstant"},{"title":"debug.setinfo","href":"/api-reference/Debug Library/debug.setinfo"},{"title":"debug.setname","href":"/api-reference/Debug Library/debug.setname"},{"title":"debug.setsafeenv","href":"/api-reference/Debug Library/debug.setsafeenv"},{"title":"debug.setstack","href":"/api-reference/Debug Library/debug.setstack"},{"title":"debug.setupvalue","href":"/api-reference/Debug Library/debug.setupvalue"}]},{"group":"Drawing Library","pages":[{"title":null,"href":"/api-reference/Drawing Library/Drawing.Fonts"},{"title":"Drawing.new","href":"/api-reference/Drawing Library/Drawing.new"},{"title":"cleardrawcache","href":"/api-reference/Drawing Library/cleardrawcache"},{"title":"getrenderproperty","href":"/api-reference/Drawing Library/getrenderproperty"},{"title":"isrenderobj","href":"/api-reference/Drawing Library/isrenderobj"},{"title":"setrenderproperty","href":"/api-reference/Drawing Library/setrenderproperty"},{"group":"Types","pages":[{"title":"Base","href":"/Base"},{"title":"Line","href":"/line"},{"title":"Text","href":"/text"},{"title":"Image","href":"/image"},{"title":"Circle","href":"/circle"},{"title":"Square","href":"/square"},{"title":"Triangle","href":"/triangle"},{"title":"Quad","href":"/quad"},{"title":"Font","href":"/font"},{"title":"Shader","href":"/shader"}]}]},{"group":"DrawingImmediate Library","pages":[{"title":"DrawingImmediate.GetPaint","href":"/api-reference/DrawingImmediate Library/DrawingImmediate.GetPaint"},{"title":"Functions","href":"/api-reference/DrawingImmediate Library/Functions"}]},{"group":"Environment Functions","pages":[{"title":"filtergc","href":"/api-reference/Environment Library/filtergc"},{"title":"getgc","description":"Returns a table of objects from the garbage collection list. If specified, tables will be included.","href":"/api-reference/Environment Library/getgc"},{"title":"getgenv","href":"/api-reference/Environment Library/getgenv"},{"title":"getreg","description":"Returns the global registry table. The registry is used to store references. Any object referenced in the registry will never be collected by the garbage collector, as the registry itself will never be collected. Thus a strong reference will always be held.","href":"/api-reference/Environment Library/getreg"},{"title":"getrenv","href":"/api-reference/Environment Library/getrenv"},{"title":"getsenv","href":"/api-reference/Environment Library/getsenv"},{"title":"gettenv","href":"/api-reference/Environment Library/gettenv"}]},{"group":"FileSystem Functions","pages":[{"title":"appendfile","href":"/api-reference/FileSystem Library/appendfile"},{"title":"delfile","href":"/api-reference/FileSystem Library/delfile"},{"title":"delfolder","href":"/api-reference/FileSystem Library/delfolder"},{"title":"dofile","href":"/api-reference/FileSystem Library/dofile"},{"title":"isfile","href":"/api-reference/FileSystem Library/isfile"},{"title":"isfolder","href":"/api-reference/FileSystem Library/isfolder"},{"title":"listfiles","href":"/api-reference/FileSystem Library/listfiles"},{"title":"loadfile","href":"/api-reference/FileSystem Library/loadfile"},{"title":"makefolder","href":"/api-reference/FileSystem Library/makefolder"},{"title":"readfile","href":"/api-reference/FileSystem Library/readfile"},{"title":"writefile","href":"/api-reference/FileSystem Library/writefile"}]},{"group":"Input Functions","pages":[{"title":"isrbxactive","href":"/api-reference/Input Library/isrbxactive"},{"title":"keypress","href":"/api-reference/Input Library/keypress"},{"title":"keyrelease","href":"/api-reference/Input Library/keyrelease"},{"title":"keytap","href":"/api-reference/Input Library/keytap"},{"title":"mouse1click","href":"/api-reference/Input Library/mouse1click"},{"title":"mouse1press","href":"/api-reference/Input Library/mouse1press"},{"title":"mouse1release","href":"/api-reference/Input Library/mouse1release"},{"title":"mouse2click","href":"/api-reference/Input Library/mouse2click"},{"title":"mouse2press","href":"/api-reference/Input Library/mouse2press"},{"title":"mouse2release","href":"/api-reference/Input Library/mouse2release"},{"title":"mousemoveabs","href":"/api-reference/Input Library/mousemoveabs"},{"title":"mousemoverel","href":"/api-reference/Input Library/mousemoverel"},{"title":"mousescroll","href":"/api-reference/Input Library/mousescroll"}]},{"group":"Instance Functions","pages":[{"title":"fireclickdetector","href":"/api-reference/Instance Library/fireclickdetector"},{"title":"fireproximityprompt","href":"/api-reference/Instance Library/fireproximityprompt"},{"title":"firetouchinterest","href":"/api-reference/Instance Library/firetouchinterest"},{"title":"getcallbackvalue","href":"/api-reference/Instance Library/getcallbackvalue"},{"title":"getcustomasset","href":"/api-reference/Instance Library/getcustomasset"},{"title":"gethui","href":"/api-reference/Instance Library/gethui"},{"title":"getinstances","href":"/api-reference/Instance Library/getinstances"},{"title":"getnilinstances","href":"/api-reference/Instance Library/getnilinstances"},{"title":"getrendersteppedlist","href":"/api-reference/Instance Library/getrendersteppedlist"}]},{"group":"Oth Library","pages":[{"title":"oth.get_original_thread","href":"/api-reference/Oth Library/oth.get_original_thread"},{"title":"oth.get_root_callback","href":"/api-reference/Oth Library/oth.get_root_callback"},{"title":"oth.hook","href":"/api-reference/Oth Library/oth.hook"},{"title":"oth.is_hook_thread","href":"/api-reference/Oth Library/oth.is_hook_thread"},{"title":"oth.unhook","href":"/api-reference/Oth Library/oth.unhook"}]},{"group":"Metatable Functions","pages":[{"title":"getnamecallmethod","href":"/api-reference/Metatable Library/getnamecallmethod"},{"title":"getrawmetatable","href":"/api-reference/Metatable Library/getrawmetatable"},{"title":"hookmetamethod","href":"/api-reference/Metatable Library/hookmetamethod"},{"title":"isreadonly","href":"/api-reference/Metatable Library/isreadonly"},{"title":"makereadonly","href":"/api-reference/Metatable Library/makereadonly"},{"title":"makewritable","href":"/api-reference/Metatable Library/makewritable"},{"title":"setnamecallmethod","href":"/api-reference/Metatable Library/setnamecallmethod"},{"title":"setrawmetatable","href":"/api-reference/Metatable Library/setrawmetatable"},{"title":"setreadonly","href":"/api-reference/Metatable Library/setreadonly"}]},{"group":"Miscellaneous Functions","pages":[{"title":"clearteleportqueue","href":"/api-reference/Miscellaneous Library/clearteleportqueue"},{"title":"getfpscap","href":"/api-reference/Miscellaneous Library/getfpscap"},{"title":"gethwid","href":"/api-reference/Miscellaneous Library/gethwid"},{"title":"getfflag","href":"/api-reference/Miscellaneous Library/getfflag"},{"title":"getfflagtype","href":"/api-reference/Miscellaneous Library/getfflagtype"},{"title":"getobjects","href":"/api-reference/Miscellaneous Library/getobjects"},{"title":"httpget","href":"/api-reference/Miscellaneous Library/httpget"},{"title":"identifyexecutor","href":"/api-reference/Miscellaneous Library/identifyexecutor"},{"title":"messagebox","href":"/api-reference/Miscellaneous Library/messagebox"},{"title":"queueonteleport","href":"/api-reference/Miscellaneous Library/queueonteleport"},{"title":"request","href":"/api-reference/Miscellaneous Library/request"},{"title":"saveinstance","href":"/api-reference/Miscellaneous Library/saveinstance"},{"title":"setclipboard","href":"/api-reference/Miscellaneous Library/setclipboard"},{"title":"setfflag","href":"/api-reference/Miscellaneous Library/setfflag"},{"title":"setfpscap","href":"/api-reference/Miscellaneous Library/setfpscap"},{"title":"setrbxclipboard","href":"/api-reference/Miscellaneous Library/setrbxclipboard"}]},{"group":"PsmSignal Library","pages":[{"title":"PsmSignal.new","href":"/api-reference/PsmSignal Library/PsmSignal.new"},{"title":null,"href":"/api-reference/PsmSignal Library/PsmConnection"}]},{"group":"RakNet Library","pages":[{"title":"raknet.add_send_hook","href":"/api-reference/RakNet Library/raknet.add_send_hook"},{"title":"raknet.remove_send_hook","href":"/api-reference/RakNet Library/raknet.remove_send_hook"},{"title":"raknet.add_receive_hook","href":"/api-reference/RakNet Library/raknet.add_receive_hook"},{"title":"raknet.remove_receive_hook","href":"/api-reference/RakNet Library/raknet.remove_receive_hook"},{"title":"raknet.send","href":"/api-reference/RakNet Library/raknet.send"},{"title":null,"href":"/api-reference/RakNet Library/RakNetPacket"}]},{"group":"Reflection Functions","pages":[{"title":"getbspval","href":"/api-reference/Reflection Library/getbspval"},{"title":"gethiddenproperties","href":"/api-reference/Reflection Library/gethiddenproperties"},{"title":"gethiddenproperty","href":"/api-reference/Reflection Library/gethiddenproperty"},{"title":"getpcd","href":"/api-reference/Reflection Library/getpcd"},{"title":"getproperties","href":"/api-reference/Reflection Library/getproperties"},{"title":"getproximitypromptduration","href":"/api-reference/Reflection Library/getproximitypromptduration"},{"title":"getsimulationradius","href":"/api-reference/Reflection Library/getsimulationradius"},{"title":"isnetworkowner","href":"/api-reference/Reflection Library/isnetworkowner"},{"title":"isscriptable","href":"/api-reference/Reflection Library/isscriptable"},{"title":"sethiddenproperty","href":"/api-reference/Reflection Library/sethiddenproperty"},{"title":"setproximitypromptduration","href":"/api-reference/Reflection Library/setproximitypromptduration"},{"title":"setscriptable","href":"/api-reference/Reflection Library/setscriptable"},{"title":"setsimulationradius","href":"/api-reference/Reflection Library/setsimulationradius"}]},{"group":"Regex Library","pages":[{"title":"Regex.Escape","href":"/api-reference/Regex Library/Regex.Escape"},{"title":"Regex.new","href":"/api-reference/Regex Library/Regex.new"}]},{"group":"Script Functions","pages":[{"title":"getloadedmodules","href":"/api-reference/Script Library/getloadedmodules"},{"title":"getrunningscripts","href":"/api-reference/Script Library/getrunningscripts"},{"title":"getscriptbytecode","href":"/api-reference/Script Library/getscriptbytecode"},{"title":"getscriptclosure","href":"/api-reference/Script Library/getscriptclosure"},{"title":"getscriptfromthread","href":"/api-reference/Script Library/getscriptfromthread"},{"title":"getscriptthread","href":"/api-reference/Script Library/getscriptthread"},{"title":"getcallingscript","href":"/api-reference/Script Library/getcallingscript"},{"title":"getscripthash","href":"/api-reference/Script Library/getscripthash"},{"title":"getscripts","href":"/api-reference/Script Library/getscripts"},{"title":"getthreadidentity","href":"/api-reference/Script Library/getthreadidentity"},{"title":"setthreadidentity","href":"/api-reference/Script Library/setthreadidentity"},{"title":"dumpbytecode","href":"/api-reference/Script Library/dumpbytecode"},{"title":"decompile","href":"/api-reference/Script Library/decompile"}]},{"group":"Signal Functions","pages":[{"title":"cansignalreplicate","href":"/api-reference/Signal Library/cansignalreplicate"},{"title":"firesignal","href":"/api-reference/Signal Library/firesignal"},{"title":"getconnection","href":"/api-reference/Signal Library/getconnection"},{"title":"getconnections","href":"/api-reference/Signal Library/getconnections"},{"title":"getsignalarguments","href":"/api-reference/Signal Library/getsignalarguments"},{"title":"getsignalargumentsinfo","href":"/api-reference/Signal Library/getsignalargumentsinfo"},{"title":"getsignalwhitelist","href":"/api-reference/Signal Library/getsignalwhitelist"},{"title":"replicatesignal","href":"/api-reference/Signal Library/replicatesignal"}]},{"group":"WebSocket Library","pages":[{"title":"WebSocket.connect","href":"/api-reference/WebSocket Library/WebSocket.connect"}]}]}]},"title":"getgenv - Potassium","buildId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","deploymentId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","dynamics":[],"chunks":[]}